import { onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted } from 'vue'
import { error } from '@/utils/logger'

const useLifeCycle = () => {
  onBeforeMount(() => {
    error('hook', 'beforeMount')
  })

  onMounted(() => {
    error('hook', 'mounted')
  })

  onBeforeUpdate(() => {
    error('hook', 'beforeUpdate')
  })

  onUpdated(() => {
    error('hook', 'updated')
  })

  onBeforeUnmount(() => {
    error('hook', 'beforeUnmount')
  })

  onUnmounted(() => {
    error('hook', 'unmounted')
  })
}

export default useLifeCycle
